﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace BTalk
{
    public partial class AesDialog : Form
    {
        public AesDialog()
        {
            InitializeComponent();
        }

        private void AesDialog_Load(object sender, EventArgs e)
        {
            var modes = Enum.GetValues(typeof(CipherMode));

            mode.DisplayMember = "Name";
            mode.ValueMember = "Mode";

            foreach (var item in modes)
            {
                mode.Items.Add(new ComboboxItem()
                {
                    Mode = (CipherMode)item,
                    Name = Enum.GetName(typeof(CipherMode), (CipherMode)item)
                });
            }
        }

        public CipherMode GetMode()
        {
            return (CipherMode)(mode.SelectedItem as ComboboxItem).Mode;
        }

        public string GetPassword()
        {
            return password.Text;
        }

        private void okBtn_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }

        private void cancelBtn_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            Close();
        }
    }

    internal class ComboboxItem
    {
        public string Name { get; set; }
        public CipherMode Mode { get; set; }
    }

  
}
